<?php

declare(strict_types=1);

namespace App\Controller\AdminApi;

use App\Service\StatMchService;
use App\Utils\RedisUtils;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\PostMapping;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\Logger\LoggerFactory;

/**
 * Class TestController
 * @package App\Controller
 *
 * @Controller(prefix="/admin/test")
 */
class TestController extends AdminBaseController
{

    /**
     * @var \Psr\Log\LoggerInterface
     */
    protected $logger;

    /**
     * @Inject()
     * @var StatMchService
     */
    private $StatService;

    public function __construct(LoggerFactory $loggerFactory)
    {
        // 第一个参数对应日志的 name, 第二个参数对应 config/autoload/logger.php 内的 key
        $this->logger = $loggerFactory->get('log', 'default');
    }

    /**
     * test
     * @PostMapping(path = "test")
     */
    public function test(RequestInterface $request)
    {
        $this->StatService->stat(0, 0);
    }
   
}